# Author: HZT
# Date: 2023/9/4
import time
import page
from base.base import Base


class WebSkHl(Base):
    # 点击汇率管理
    def sk_hl_click_hlgl(self):
        self.base_find_first(page.web_sk_hl_hlgl).click()

    # 点击卡种
    def sk_hl_click_kz(self):
        self.base_click(page.web_sk_hl_kz)

    # 获取卡种列表元素
    def sk_hl_get_kzlb(self):
        return self.base_finds(page.web_sk_hl_kzlb)

    # 点击test001
    def sk_hl_click_tSteam(self):
        self.base_click(page.web_sk_hl_tSteam)

    # 点击国家
    def sk_hl_click_gj(self):
        self.base_click(page.web_sk_hl_gj)

    # 点击美国
    def sk_hl_click_mg(self):
        self.base_click(page.web_sk_hl_mg)

    # 点击速度快
    def sk_hl_click_sdk(self):
        self.base_click(page.web_sk_hl_sdk)

    # 点击新增
    def sk_hl_click_xz(self):
        self.base_click(page.web_sk_hl_xz)

    def sk_hl_get_xls(self):
        return self.base_finds(page.web_sk_hl_xl)

    # 点击金额类型1
    def sk_hl_click_je1(self):
        self.sk_hl_get_xls()[-1].click()

    # 点击固定面值
    def sk_hl_click_gdmz(self):
        self.base_finds(page.web_sk_hl_gd1)[-1].click()

    # 获取输入框元素
    def sk_hl_get_srs(self):
        return self.base_finds(page.web_sk_hl_sr)

    # 输入范围1
    def sk_hl_input_fw1(self, text):
        self.sk_hl_get_srs()[3].clear()
        self.sk_hl_get_srs()[3].send_keys(text)

    # 输入汇率1
    def sk_hl_input_hl1(self, text):
        self.sk_hl_get_srs()[4].clear()
        self.sk_hl_get_srs()[4].send_keys(text)

    # 点击保存
    def sk_hl_click_bc(self):
        self.base_click(page.web_sk_hl_bc)

    # 获取提示
    def sk_hl_get_bcts(self):
        return self.base_get_text(page.web_sk_hl_ts)

    # 点击提示ok
    def sk_hl_click_tsok(self):
        self.base_click(page.web_sk_hl_tsok)

    # 获取保存成功
    def sk_hl_get_bccg(self):
        return self.base_get_text(page.web_sk_hl_bccg)

    # 点击保存ok
    def sk_hl_click_bcok(self):
        self.base_click(page.web_sk_hl_bcok)

    # 点击添加
    def sk_hl_click_tj(self):
        self.base_click(page.web_sk_hl_tj)

    # 点击金额类型2
    def sk_hl_click_je2(self):
        self.sk_hl_get_xls()[-1].click()

    # 点击面值区间
    def sk_hl_click_mzqj(self):
        self.base_finds(page.web_sk_hl_mzqj)[-1].click()

    # 点击区间选择
    def sk_hl_click_qjxz(self):
        self.sk_hl_get_xls()[-1].click()

    # 选择区间
    def sk_hl_click_xzqj(self):
        self.base_click(page.web_sk_hl_qj)

    # 输入汇率2
    def sk_hl_input_hl2(self, text):
        self.sk_hl_get_srs()[7].send_keys(text)

    # 点击金额类型3
    def sk_hl_click_je3(self):
        self.sk_hl_get_xls()[-1].click()

    # 点击碎卡
    def sk_hl_click_sk(self):
        self.base_finds(page.web_sk_hl_sk)[-1].click()

    # 输入汇率3
    def sk_hl_input_hl3(self, text):
        self.sk_hl_get_srs()[9].send_keys(text)

    # 点击金额类型4
    def sk_hl_click_je4(self):
        self.sk_hl_get_xls()[-1].click()

    # 点击倍数
    def sk_hl_click_bs(self):
        self.base_finds(page.web_sk_hl_bs)[-1].click()

    # 输入范围4
    def sk_hl_input_fw4(self, text):
        self.sk_hl_get_srs()[11].send_keys(text)

    # 输入汇率4
    def sk_hl_input_hl4(self, text):
        self.sk_hl_get_srs()[12].send_keys(text)

    # 点击金额类型5
    def sk_hl_click_je5(self):
        self.sk_hl_get_xls()[-1].click()

    # 输入范围5
    def sk_hl_input_fw5(self, text):
        self.sk_hl_get_srs()[14].send_keys(text)

    # 输入汇率5
    def sk_hl_input_hl5(self, text):
        self.sk_hl_get_srs()[15].send_keys(text)

    # 点击删除
    def sk_hl_click_sc(self):
        self.base_click(page.web_sk_hl_sc)

    # 点击删除确定
    def sk_hl_click_scqd(self):
        self.base_click(page.web_sk_hl_scqd)

    # 获取状态元素列表
    def sk_hl_get_zts(self):
        return self.base_finds(page.web_sk_hl_zt)

    # 组合新增功能
    def sk_hl_xz(self):
        self.sk_hl_click_kz()
        time.sleep(0.5)
        self.sk_hl_click_tSteam()
        time.sleep(0.5)
        self.sk_hl_click_gj()
        time.sleep(0.5)
        self.sk_hl_click_mg()
        time.sleep(0.5)
        self.sk_hl_click_sdk()
        time.sleep(0.5)
        self.sk_hl_click_xz()
